<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="物料编码">
              <a-input placeholder="请输入物料编码" v-model="queryParam.materialNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
        </span>

      </a-table>
    </div>

    <zxjEip2cBkkc-modal ref="modalForm" @ok="modalFormOk"></zxjEip2cBkkc-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEip2cBkkcModal from './modules/ZxjEip2cBkkcModal'
  export default {
    name: "ZxjEip2cBkkcList",
    mixins:[JeecgListMixin],
    components: {
      ZxjEip2cBkkcModal
    },
    data () {
      return {
        description: '板卡库存管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNo'
          },
          {
            title:'工厂',
            align:"center",
            dataIndex: 'factory'
          },
          {
            title:'库存物资名称',
            align:"center",
            dataIndex: 'stockMatName'
          },
          {
            title:'库存物资数量',
            align:"center",
            dataIndex: 'stockMatNum'
          },
          {
            title:'库存物资类型',
            align:"center",
            dataIndex: 'stockMaterialType'
          },
          {
            title:'库存物资生产日期',
            align:"center",
            dataIndex: 'stockMatYieldDate'
          },
          {
            title:'供应商编号',
            align:"center",
            dataIndex: 'supplierCode'
          },
          {
            title:'工艺编号',
            align:"center",
            dataIndex: 'processRouteNo'
          },
          {
            title:'抓取状态',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (text) {
              return !text?"":(text == 0?'已抓取':'未抓取')
            }
          },
          {
            title:'抓取时间',
            align:"center",
            dataIndex: 'updateTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/apis/zxjEip2cBkkc/list",
        },
        dictOptions:{
        } 
      }
    },
    computed: {
    },
    methods: {
      initDictConfig(){
      },
      handleDetail(record){
        this.$refs.modalForm.addModal(record);
        this.$refs.modalForm.title="详细信息";
      }
       
    }
  }
</script>